#include"producer.h"
#include<string>
#include<iostream>
#include<unistd.h>
using namespace std;
producer::producer()
{	
}

void producer::run()
{
	cout<<"producer在行动!"<<endl;
	Portal p;
	while(p.isnull())
	{
		cout<<"producer..."<<endl;
		sleep(1);
		p=attribute["kernel_instance"].castto<Kernel*>()->findportal("c3pom.other.test");

	}
	cout<<"....?"<<&p<<endl;
	Portal_Block pb;
	pb["test"]=*(new string("fuck you"));//消息
	while(true)//每秒中加入一条数据
	{ 
		cout<<"啦啦啦,producer在行动"<<endl;
		p<<pb;
		sleep(1);
	}
}
